//
//  AllBookViewController.m
//  iBook
//
//  Created by wangjing on 14/12/17.
//  Copyright (c) 2014年 wikiflyer. All rights reserved.
//

#import "AllBookViewController.h"
#import "TopView.h"

@interface AllBookViewController ()

@end

@implementation AllBookViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    //    [self initSegControl];
}
//初始化导航栏
-(void)initNavigation{
    //    [self.navigationItem setHidesBackButton:YES];
    
    TopView *topView = [[TopView alloc]initWithFrame:CGRectMake(0, 22, 320, 70)];
    self.navigationItem.titleView = topView;
    self.navigationController.navigationBar.hidden = YES;
    [self.view addSubview:topView];
    
}
//初始化Segmented Control
-(void)initSegControl{
    NSArray *segmentedArray = [NSArray arrayWithObjects:@"左边",@"右边",nil];
    self.segControl = [[UISegmentedControl alloc]initWithItems:segmentedArray];
    CGFloat segW = 80*segmentedArray.count;
    CGFloat segH = 30;
    CGFloat segX = (320-segW)/2;
    CGFloat segY = 64;
    _segControl.frame = CGRectMake(segX,segY,segW,segH);
    _segControl.selectedSegmentIndex = 0;
//    _segControl.tintColor = [UIColor blueColor];
    
    [self.view addSubview:self.segControl];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



- (IBAction)popBtn:(id)sender {
//    [self.navigationController popViewControllerAnimated:YES];
    [self initNavigation];
}
@end
